package com.aliware.tianchi;

import org.apache.dubbo.rpc.listener.CallbackListener;

/**
 * @author daofeng.xjf
 *
 * 客户端监听器
 * 可选接口
 * 用户可以基于获取获取服务端的推送信息，与 CallbackService 搭配使用
 *
 */
public class CallbackListenerImpl implements CallbackListener {

    @Override
    public void receiveServerMsg(String msg) {

        System.out.println("receive msg from server :" + msg);
//        String[] msgItem = msg.split(",");
//        if (msgItem.length == 3)
//        {
//            if (msgItem[0] == "small")
//            {
//                LoadBalanceManager.CSmall = Double.parseDouble(msgItem[1]);
//                LoadBalanceManager.MSmall = Double.parseDouble(msgItem[2]);
//            }else if (msgItem[0] == "medium")
//            {
//                LoadBalanceManager.CMedium = Double.parseDouble(msgItem[1]);
//                LoadBalanceManager.MMedium = Double.parseDouble(msgItem[2]);
//            }else if (msgItem[0] == "large")
//            {
//                LoadBalanceManager.CLarge = Double.parseDouble(msgItem[1]);
//                LoadBalanceManager.MLarge = Double.parseDouble(msgItem[2]);
//            }
//        }
    }

}
